﻿@using MvcAtletIS.Helpers;
@model IEnumerable<MvcAtletIS.Models.Contacts>

@{
    ViewBag.Title = "Kontakty";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Kontakty</h2>

@using (Html.BeginForm())
{   
    <p>        
        Vyhľadanie podľa priezviska: 
        @Html.TextBox("SearchString") 
        <input type="submit" value="Vyhľadaj" />
    </p>    
}

<p>
    @Html.ActionLink("Pridať nový kontakt", "Create")
</p>

<table>
    <tr>
        <th width="150px">
            Priezvisko
        </th>
        <th width="100px">
            Meno
        </th>
        <th width="100px">
            Pozícia
        </th>
        <th width="300px">
            Klub
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        
        <td>
            @Html.DisplayFor(modelItem => item.Surname)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Firstname)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Position)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Clubs.Name)
        </td>
        <td>
            @Html.ImageActionLink(Url.Content("~/Content/icons/preview.gif"), "", "Details", new { id = item.ID }, new { title = "Zobraziť", border = 0, hspace = 2 }) |
            @Html.ImageActionLink(Url.Content("~/Content/icons/edit.gif"), "", "Edit", new { id = item.ID }, new { title = "Editovať", border = 0, hspace = 2 })
        </td>
    </tr>
}

</table>

<p>
    @Html.ActionLink("Pridať nový kontakt", "Create")
</p>
